package com.york.tinyrpc.protoss.config;

import com.york.tinyrpc.protoss.constant.LoadBalancerConstants;
import com.york.tinyrpc.protoss.constant.RetryStrategyConstants;
import com.york.tinyrpc.protoss.constant.SerializerConstants;
import com.york.tinyrpc.protoss.constant.TolerantStrategyConstants;
import lombok.Data;


/**
 * TinyRPC 框架配置
 */
@Data
public class TinyRpcConfig {

    /**
     * 名称
     */
    private String name = "tiny-rpc";

    /**
     * 版本号
     */
    private String version = "1.0";

    /**
     * 服务器主机名
     */
    private String serverHost = "localhost";

    /**
     * 服务器端口号
     */
    private Integer serverPort = 8000;

    /**
     * 是否开启Mock服务
     */
    private boolean mock = false;

    /**
     * 指定序列化器
     */
    private String serializer = SerializerConstants.JDK_SERIALIZER;

    /**
     * 注册中心的相关配置
     */
    private RegistryCenterConfig registryCenterConfig = new RegistryCenterConfig();

    /**
     * 负载均衡器相关配置,默认值为轮询模式
     */
    private String loadBalancer = LoadBalancerConstants.ROUND_ROBIN;

    /**
     * 重试策略相关配置,默认值为固定时间间隔
     */
    private String retryStrategy = RetryStrategyConstants.FIXED_INTERVAL;

    /**
     * 容错策略相关配置,默认值为Fail-Fast
     */
    private String tolerantStrategy = TolerantStrategyConstants.FAIL_FAST;

}